from data_generation import *
import matplotlib.pyplot as plt

item_para = ItemPara(30)
gener = StudentPara(1000)
ability = gener.mul_ability([0,0],[[1,0.25],[0.25,0.25]])
sun_theta= gener.sun_ability(ability[:,0],np.random.random(4),1)
sun_tau= gener.sun_ability(ability[:,1],np.random.random(4),0.25)
# print(np.nanvar(sun_theta))
# print(np.exp(ability))
a,b,c = item_para.ac_para([1,2.5],[0,1],[0,0.2])
xi,omega = item_para.rt_para([4,0.25],[2,0.25])
resp,_ = item_para.get_irt_ra(sun_theta,a,b,c,return_resp_possibility=True)
rt = item_para.get_rt(xi,omega,sun_tau)
# print(np.nanmean(resp),np.nanmean(_))
# print(np.nanmean(rt<3.3))
# print(a,b,c)
# print(xi,omega)
ra,rt,flag_mat = item_para.backward_convert(resp,rt,3800,0.25,2,0.25)
plt.hist(np.exp(rt.flatten()),bins=100)
# plt.hist(np.exp(rt.flatten()),bins=100)
plt.show()